home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / Samples / Moofwars 1.02 / MoofWars Sprocket / •Headers / TEnemySprite.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-11-05  |  2.0 KB  |  79 lines  |  [TEXT/CWIE]

  1. /*************************************************************************************
  2. TEnemySprite.h
  3.  
  4. This is the class used to represent the enemy ship in the game.  Eventually,
  5. one ship class will represent both friendly and enemy ships, since the only
  6. major difference is the keyset.  A computer controlled ship could be 
  7. different.
  8.  
  9.  
  10. Author: Timothy Carroll
  11. Apple Developer Technical Support
  12. timc@apple.com
  13.  
  14. Modification History: 
  15.  
  16. 8/15/96        TMC     Initial Release
  17.  
  18. Copyright © 1996 Apple Computer, Inc., All Rights Reserved
  19.  
  20.  
  21. You may incorporate this sample code into your applications without
  22. restriction, though the sample code has been provided "AS IS" and the
  23. responsibility for its operation is 100% yours.  However, what you are
  24. not permitted to do is to redistribute the source as "DSC Sample Code"
  25. after having made changes. If you're going to re-distribute the source,
  26. we require that you make it clear in the source that the code was
  27. descended from Apple Sample Code, but that you've made changes.
  28. *************************************************************************************/
  29.  
  30. #ifndef _TENEMYSPRITE_
  31. #define _TENEMYSPRITE_
  32.  
  33. #pragma once
  34. #include "TSprite.h"
  35.  
  36. #if PRAGMA_STRUCT_ALIGN
  37. #pragma options align=power
  38. #endif
  39.  
  40.  
  41. struct TEnemySpriteData
  42. {
  43.     TSpriteData spriteData;
  44.     SInt16         rotateInterval; // turning rate;
  45.     SInt16        shotInterval;   // firing rate;
  46.     TSpriteCollection *shotsGroup;   // where my shots should be added.
  47. };
  48.  
  49. typedef struct TEnemySpriteData **TEnemySpriteDataHandle;
  50.  
  51. class TEnemySprite : public TSprite
  52. {
  53.  
  54.     public:
  55.     
  56.     enum {
  57.         kSpriteType = 'BADG'
  58.     };
  59.  
  60.     TEnemySprite (TEnemySpriteData *data);
  61.     ~TEnemySprite (void);
  62.     
  63.     virtual void ProcessSprite (void);
  64.     virtual void Collision (TSprite *theSprite);
  65.     
  66.     protected:
  67.     SInt16 fRotateInterval;
  68.     SInt16 fRotateValue;
  69.     SInt16 fShotInterval;
  70.     SInt16 fShotValue;
  71.     TSpriteCollection *fShotsGroup;   // where my shots should be added.
  72. };
  73.  
  74. #if PRAGMA_STRUCT_ALIGN
  75. #pragma options align=reset
  76. #endif
  77.  
  78.  
  79. #endif /* _TENEMYSPRITE_ */